package com.chazz.service.impl;/**
 *
 */

import com.chazz.dao.CategoryidDao;
import com.chazz.dao.impl.CategoryidDaoImpl;
import com.chazz.entity.Category;
import com.chazz.service.CategoryidService;

import java.util.List;

/**
 *
 * @title: CategoryidServiceImpl
 * @Author ZhaoHongRui
 * @Date: 2020/9/21 15:56
 * @Version 1.0
 */

public class CategoryidServiceImpl implements CategoryidService {
    CategoryidDao categoryidDao = new CategoryidDaoImpl();

    @Override
    public List<Category> showAllCategories() {
        return categoryidDao.showAllCategories();
    }

    @Override
    public List<List<Category>> showSmallCategories() {
        return categoryidDao.showSmallCategories();
    }


    /**
     * 返回查询结果的分类集合
     *
     * @return
     */
    @Override
    public List<Category> getCategoriesList(String categoryName) {
        return categoryidDao.findByCategoryName(categoryName);
    }

    /**
     * 根据商品分类名称查询商品编号
     *
     * @param categoryname
     * @return
     */
    @Override
    public int findCategoryIdByName(String categoryname) {
        return categoryidDao.findCategoryId(categoryname);
    }


}
